<?php

namespace App\HttpController\Api\Admin;

use App\Service\Admin\LevelService;
use Swoole\Http\Status;

/**
 * 职级管理-控制器
 * @author LZH
 * @since: 2021/08/12
 * Class Level
 */
class Level extends AdminBase
{
    /**
     * 初始化方法
     * @author LZH
     * @since: 2021/08/12
     */
    protected function init(): void
    {
        $this->service = new LevelService();
    }

    /**
     * 获取职级列表
     */
    public function getLevelList()
    {
        $result = $this->service->getLevelList();
        if (!empty($result)) {
            return $this->respondQuery($result);
        } else {
            return $this->failServerError();
        }
    }
}
